package com.dt.dubai.core.aliyun.aliyunSms.controller;

import com.dt.dubai.core.aliyun.aliyunSms.service.ser.AliyunSmsService;
import com.dt.dubai.core.comm.PageData;
import com.dt.dubai.core.exception.PageErrorMesg;
import com.dt.dubai.core.utile.I18nUtile;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping(value = "/aliyun/aliyunSms")
public class AliyunSmsController {

    @Autowired
    protected AliyunSmsService aliyunSmsService;

    @Autowired
    protected I18nUtile i18nUtile;

    @RequestMapping(value = "/sendSms", method = RequestMethod.POST)
    @ResponseBody
    public PageData<String> sendSms(String phoneNumbers) {
        aliyunSmsService.sendSms(phoneNumbers);
        return new PageData().success("SUCESS", i18nUtile.getMessage(PageErrorMesg.E0.name()));
    }

}
